﻿namespace Sgr.Indentity.Application.Commands
{
    public static class EmailTemplates
    {
        /// <summary>
        /// 获取验证码邮件模板
        /// </summary>
        public static string GetVerificationCodeTemplate(string appName, string code, int expireMinutes)
            => @$"<!DOCTYPE html>
<html lang='zh-CN'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>{appName} - 验证码</title>
    <style>
        :root {{
            --primary-color: #007bff;
            --text-color: #333333;
            --border-color: #d6e9f8;
            --warning-color: #e74c3c;
            --gray-color: #95a5a6;
        }}
        * {{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }}
        body {{
            line-height: 1.8;
            background-color: #f5f5f5;
            padding: 20px;
        }}
        .container {{
            max-width: 600px;
            margin: 0 auto;
            background: #ffffff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 30px;
        }}
        .code-box {{
            background: #f8f9fa;
            border: 2px dashed var(--border-color);
            border-radius: 8px;
            padding: 20px;
            margin: 25px 0;
            text-align: center;
        }}
        .verification-code {{
            font-size: 32px;
            font-weight: bold;
            letter-spacing: 8px;
            color: var(--primary-color);
            font-family: 'Courier New', monospace;
        }}
        .notice {{
            color: var(--text-color);
            font-size: 14px;
            margin: 20px 0;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 6px;
        }}
        .warning {{
            color: var(--warning-color);
            font-weight: 500;
            font-size: 14px;
            padding: 15px;
            background: #fff5f5;
            border-radius: 6px;
            margin: 20px 0;
        }}
        .footer {{
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
            text-align: center;
            color: var(--gray-color);
            font-size: 12px;
        }}
        @media (max-width: 480px) {{
            .container {{
                padding: 15px;
            }}
            .verification-code {{
                font-size: 28px;
                letter-spacing: 6px;
            }}
        }}
    </style>
</head>
<body>
    <div class='container'>
        <p>您的验证码如下：</p>
        <div class='code-box'>
            <div class='verification-code'>{code}</div>
        </div>
        <div class='notice'>
            <p>• 验证码有效期：{expireMinutes} 分钟</p>
            <p>• 如非本人操作，请忽略此邮件</p>
            <p>• 请勿将验证码泄露给他人</p>
        </div>
        <div class='warning'>
            安全提示：为保障账号安全，请勿将验证码转发或截图分享给他人，谨防诈骗。
        </div>
        <div class='footer'>
            <p>此邮件由系统自动发送，请勿直接回复</p>
            <p>© {DateTime.UtcNow.Year} {appName}. All rights reserved.</p>
        </div>
    </div>
</body>
</html>";
    }
}